
def method1():
    sql = []
    with open('areas.sql', 'r') as f:
        for line in f.readlines():
            line = list(line)
            max = len(line)-1
            i=0
            while i < max:
                if line[i]=='\'':
                    before = line[i-1]
                    after = line[i+1]
                    if ord(before) in range(48, 57) or ord(after) in range(48, 57):
                        line.pop(i)
                        max -= 1
                        i-=1
                i+=1

            sql.append(''.join(line))

    print(''.join(sql))

def method2():
    sql = ''
    with open('areas.sql', 'r') as f:
        for line in f.readlines():
            new_line = line[0]
            for i in range(1, len(line)-1):
                if line[i]=="'":
                    before = line[i - 1]
                    after = line[i + 1]
                    if ord(before) in range(48, 58) or ord(after) in range(48, 57):
                        continue
                new_line += line[i]
            new_line += line[-1]
            sql+=(new_line)

    print(sql)

    with open('areas.sql', 'w') as f:
        f.write(sql)

if __name__ == '__main__':
    method2()

